/**
  ******************************************************************************
  * @file           : sensor.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */	
#ifndef __SENSOR_H
#define __SENSOR_H

#include <stdint.h>
#include "si2c_comm.h"

#define COLLECTOR_DATA_FLAG_POWR       0x0001
#define COLLECTOR_DATA_FLAG_TEMP       0x0002
#define COLLECTOR_DATA_FLAG_HUMI       0x0004
#define COLLECTOR_DATA_FLAG_NH3        0x0008
#define COLLECTOR_DATA_FLAG_CO2        0x0010
#define COLLECTOR_DATA_FLAG_TVOC       0x0020
#define COLLECTOR_DATA_FLAG_PRES       0x0040
#define COLLECTOR_DATA_FLAG_LUMI       0x0080
#define COLLECTOR_DATA_FLAG_H2S        0x0100

typedef struct
{
	volatile uint8_t Status_Pow;	
  
	volatile float temperature;
	volatile uint8_t Status_T;
  
	volatile float humidity;
	volatile uint8_t Status_H;

	volatile uint16_t nh3;
	volatile uint8_t Status_NH3;
  
	volatile uint16_t co2;
	volatile uint8_t Status_CO2;
  
  volatile uint16_t tvoc;
	volatile uint8_t Status_TVOC;
  
  volatile int16_t pressure;	
	volatile uint8_t Status_Pres;
}SensorType;

typedef struct
{
	volatile uint8_t  humidity;
	volatile uint8_t  nh3;
  volatile uint16_t flag;
	volatile int16_t  temperature;
  volatile uint16_t co2;
	volatile uint16_t tvoc;
	volatile int16_t  pressure;
}Collector_DataInterfaceType;

extern volatile SensorType SENSOR;

extern volatile uint8_t  SHT30_FailCount;

extern volatile uint16_t NH3_WarmCount;
extern volatile uint8_t  NH3_FailCount;
#endif
/************************ END OF FILE *********/
